<template>
<div class="">
    <p v-show="flag">通过v-show控制元素</p>
    <button @click="flag=!flag">显示/隐藏</button>
</div>
</template>

<script setup>
import { ref } from 'vue';
const flag = ref(true)
</script>

<style scoped></style>
